package com.ss.android.common.util;

import com.ss.android.http.legacy.a.NameValueImpl;

import java.util.ArrayList;
import java.util.List;

import inline.TextDemo;

@Deprecated public final class UrlBuilder {
    public final List mList = new ArrayList();
    public String mUrl;

    public UrlBuilder() {
        this.mUrl = null;
    }

    public UrlBuilder(String arg2) {
        this.mUrl = arg2;
    }

    public final void addParam(String arg3, String arg4) {
        this.mList.add(new NameValueImpl(arg3, arg4));
    }

    public final String build() {
        String v0;
        if(this.mList.isEmpty()) {
            v0 = this.mUrl;
        }
        else {
            v0 = TextDemo.a(this.mList, "UTF-8");
            if(this.mUrl != null && this.mUrl.length() != 0) {
                v0 = this.mUrl.indexOf(63) >= 0 ? this.mUrl + "&" + v0 : this.mUrl + "?" + v0;
            }
        }

        return v0;
    }

    public final void addParam(String arg4, int arg5) {
        this.mList.add(new NameValueImpl(arg4, String.valueOf(arg5)));
    }

    public final void addParam(String arg5, long arg6) {
        this.mList.add(new NameValueImpl(arg5, String.valueOf(arg6)));
    }

    public final String toString() {
        return this.build();
    }
}

